#ifndef _RECTANGLE_MODEL_H
#define _RECTANGLE_MODEL_H

#ifndef RECTANGLE_PIPE_LENGTH
#define RECTANGLE_PIPE_LENGTH	(2.2)
#endif

#ifndef RECTANGLE_PIPE_WIDTH
#define RECTANGLE_PIPE_WIDTH	(2.4)
#endif

#ifndef RECTANGLE_PIPE_HEIGHT
#define RECTANGLE_PIPE_HEIGHT	(0.4)
#endif

#ifndef RECTANGLE_VELOCITY
#define RECTANGLE_VELOCITY	(0)
#endif

#include "mtxlib.h"

/**					
*					   |000	  |pipeLength, cross section is in x,z coordinate
*	pipe like that     |000   |   
*	  emergePoint------|000   |
*					   |______|
*	
*						_____
*					   |  .  | --> cross section width
*					   |_____| --> emergePoint in the center
*
*/

class RectangleModel{
	private:
		static RectangleModel *rectangleModel;

		RectangleModel(vector3 emergePoint = vector3(0, 0, 0),
			float pipeLength = RECTANGLE_PIPE_LENGTH,
			float width = RECTANGLE_PIPE_WIDTH,
			float height = RECTANGLE_PIPE_HEIGHT){
				this->emergePoint.x = emergePoint.x;
				this->emergePoint.y = emergePoint.y;
				this->emergePoint.z = emergePoint.z;

				this->pipeLength = pipeLength;

				this->width = width;

				this->height = height;

				this->velocity = RECTANGLE_VELOCITY;
		}

	public:
		vector3 emergePoint;
		float pipeLength;
		float width;
		float height;
		float velocity;

		static RectangleModel* initInstance(
			vector3 emergePoint = vector3(0, 0, 0),
			float pipeLength = RECTANGLE_PIPE_LENGTH,
			float width = RECTANGLE_PIPE_WIDTH,
			float height = RECTANGLE_PIPE_HEIGHT);

		static RectangleModel* getInstance();

		vector3 getPosition();

		vector3 getVelocity();
};

#endif